package com.bao.work;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;

/**
 * @author baoye
 * @date 2024-08-06/18:33
 */
public class Work02 {
    public static void main(String[] args) throws IOException {
        ByteArrayOutputStream bos=new ByteArrayOutputStream();
        bos.write(1);
        bos.write("五六".getBytes());
        bos.close();
        ByteArrayInputStream bis=new ByteArrayInputStream(bos.toByteArray());
        byte[] car=new byte[1024];
        int len;
        while((len=bis.read(car))!=-1){
            System.out.println(new String(car,0,len));
        }
        bis.close();
    }
}
